<template>
  <div class="demo">
    <div class="demo-title">基本用法</div>
    <div class="demo-content">
      <Button type="primary" @click="showDrawer">Open</Button>
      <Drawer
        v-model:visible="open"
        class="custom-class"
        root-class-name="root-class-name"
        :root-style="{ color: 'blue' }"
        style="color: red"
        title="Basic Drawer"
        placement="right"
        @after-open-change="afterOpenChange"
      >
        <p>Some contents...</p>
        <p>Some contents...</p>
        <p>Some contents...</p>
      </Drawer>
    </div>
  </div>
</template>

<script lang="ts" setup>
  import { ref } from 'vue';
  import Button from '@sscd/button';
  import Drawer from '@sscd/drawer';
  const open = ref<boolean>(false);
  const afterOpenChange = (bool: boolean) => {
    console.log('open', bool);
  };
  const showDrawer = () => {
    open.value = true;
  };
</script>
